Before your begin
Log in to the Azure portal . Create a MySQL database on Azure Database for MySQL (Preview) service . For details , refer to How to create MySQL database from Portal or How to create MySQL database using CLI.Firewall configuration
Azure database for MySQL provides tighter security using Firewall to protect your data. When using this service with App Service Web Apps , you need to keep in mind that the outbound IPs are dynamic in nature .- To make sure the availability of your web app is not compromised , we recommend to all the rule to allow ALL IPs as shown in the image below. Note: We are working with Azure database for MySQL (Preview) team for a long term solution to avoid allowing all IPs.
- You can explicitly add all the outbound IPs for your web app to MySQL server configuration . To learn more , see how to get outbound IPs for App Service.
App service infrastructure tries to keep the outbound IPs the same as best as we can , but when recycle or scale operation occurs it may change since we add new machines on every region frequently to increase our capacity to server customers. If this changes , the app will experience downtime since it can no longer connect to the database. Keep this mind when choosing one of the option mentioned above.
SSL configuration
Azure database for MySQL (Preview) has SSL Enabled . If your application is not using SSL to connect to the database , then you need to Disable SSL on MySQL server. For details on how to configure SSL , See using SSL with Azure database for MySQL (Preview).
Migrating from MySQL in-app database to Azure Database for MySQL (Preview)
You can migrate MySQL in-app database to Azure database for MySQL (Preview) using Export feature. Note in order to use this feature to export the database , you need to :- Disable SSL since the feature does not work with MySQL database connected via SSL.
- Allow all IPs is configured on your MySQL server